/**
 * @Date 2023-02-21 10:03:49
 * @Remark
 */

// react
import React from "react";
import { state } from "./state";
import { dictState } from "state/global";
// components & widget
// style
// config
// script & methods & public
// store
// controller
// interface
// 其它

const TableColumns = [
  {
    title: "借阅Id",
    dataIndex: "id",
  },
  {
    title: "用户Id",
    dataIndex: "userId",
  },
  {
    title: "用户账号",
    dataIndex: "userName",
  },
  {
    title: "副本Id",
    dataIndex: "copyId",
  },
  {
    title: "书名",
    dataIndex: "title",
  },
  {
    title: "作者",
    dataIndex: "author",
  },
  {
    title: "出版社",
    dataIndex: "publisher",
  },
  {
    title: "ISBN",
    dataIndex: "isbn",
  },
  {
    title: "所在书架",
    dataIndex: "shelfId",
     render:(el:number) => {
          return state.getShelfList().find((item) => item.shelfId === el)?.shelfName;
        }
  },
  {
    title: "借阅时间",
    dataIndex: "borrowDate",
  },
  {
    title: "状态",
    dataIndex: "status",
    render: (el:string) => dictState.BorrowStatusList.find(item => item.code === el)?.name
  },
];

export default TableColumns;
